import Mock from 'mockjs';

let user = [{
		key: "/user/detail",
		method: "get",
		data: Mock.mock({
			'STATUS': "SUCCESS",
			'data': {
				'user': {
					'id': '@increment(1)',
					'account|6': /[a-z][A-Z][0-9]/,
					'nickName': '@cname()',
					'age': 20,
					'sex': '@boolean()',
					'tel|11': /[0-9]/,
					'secId|18': /[0-9]/,
					'headImg': '@image("200x200")',
					'password': '123456'
				},
				'roles':  [{
					'roleId': '2',
					'roleName': "角色角色2"
				},
				{
					'roleId': '3',
					'roleName': "角色角色3"
				},],
				'permissions': [{
						id: 1,
						name: "系统管理",
						permissions: [{
								id: 2,
								name: "用户列表",
								path: "/user"
							},
							{
								id: 3,
								name: "角色列表",
								path: "/role"
							},
							{
								id: 4,
								name: "权限列表",
								path: "/permission"
							}
						]
					},
					{
						id: 5,
						name: "学生管理",
						permissions: [{
							id: 6,
							name: "学生列表",
							path: "/student"
						}]
					},
					{
						id: 7,
						name: "付款管理",
						permissions: [{
							id: 8,
							name: "付款列表",
							path: "/pay"
						}]
					},
				],
				'ct': '@datetime("yyyy-MM-dd hh:mm:ss")'
			}
		})
	},

	{
		key: "/user/list",
		method: "get",
		data: () => {
			return Mock.mock({
				'STATUS': "SUCCESS",
				'data': {
					'current': 0,
					'size': 10,
					'pages': 6,
					'total': 55,
					"records|10": [{
						'userId': '@increment(1)',
						'account|6': /[a-z][A-Z][0-9]/,
						'nickName': '@cname()',
						'age': 20,
						'sex': true,
						'tel|11': /[0-9]/,
						'secId|18': /[0-9]/,
						'headImg': '@image("200x200")',
						'ct': '@datetime("yyyy-MM-dd hh:mm:ss")'
					}]
				}
			});
		}
	},
	{
		key: "/user",
		method: "delete",
		data: function() {
			return Mock.mock({
				'STATUS': "SUCCESS",
				'data': "",
			});
		}
	},
	{
		key: "/user",
		method: "put",
		data: function() {
			return Mock.mock({
				'STATUS': "SUCCESS",
				'data': "",
			});
		}
	},
	{
		key: "/user",
		method: "post",
		data: function() {
			return Mock.mock({
				'STATUS': "SUCCESS",
				'data': "",
			});
		}
	},
];

export default user;
